package qf.wlh.com.oneprisdent.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import qf.wlh.com.oneprisdent.R;

/**
 * Created by zyq on 2016/11/24.
 */

//我是
public class DateAdapter extends PagerAdapter {
    private List data=new ArrayList();
    private Context context;
    private List <String>list=new ArrayList<>();
    private ListView listView;
    private ListViewAdapter adapter;

    public DateAdapter(List data, Context context,List<String>list) {
        this.data = data;
        this.context = context;
        adapter=new ListViewAdapter();
    }

    @Override
    public int getCount() {
        return 0;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public View instantiateItem(ViewGroup container, int position) {
        View view= LayoutInflater.from(context).inflate(R.layout.date_layout_item,null);
        listView= (ListView) view.findViewById(R.id.listview);

        listView.setAdapter(adapter);
        container.addView(view);
        return view;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
       if ( object instanceof View){
           View view = (View) object;
           container.removeView(view);
       }
    }

}
